package gui;

import java.awt.Color;
import java.awt.Font;
import java.awt.GridBagLayout;

import javax.swing.ImageIcon;
import javax.swing.JPanel;
import java.awt.Dimension;
import javax.swing.JLabel;

import code.Language;
import code.Settings;

import java.awt.Rectangle;
import java.io.File;
import java.util.HashMap;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.border.Border;
import javax.swing.border.EmptyBorder;

public class DataIntegrityMain extends JPanel {

	Color c= new Color(0x80, 0x80, 0xFF);
	
	Color TAc = new Color(246, 250, 250);
	
	private static final long serialVersionUID = 1L;
	
	private JLabel jLabel = null;

	private JLabel jLabel1 = null;

	private JLabel jLabel2 = null;

	private JLabel jLabel3 = null;

	private JLabel jLabel4 = null;

	private JLabel jLabel5 = null;

	ATOCOmain atocoframe;
	
	private HashMap labels;

	private JScrollPane jScrollPane = null;

	private JTextArea jTextArea = null;

	private JLabel jLabel6 = null;
	
	Border empty = new EmptyBorder(0,0,0,0);
	
	private Settings s;
	
	/**
	 * This is the default constructor
	 */
	public DataIntegrityMain(ATOCOmain atocoframe) {
		super();
		s = new Settings();
		Language l = new Language();
		labels = l.changeLanguage((String) s.global.get("language"), "DataIntegrityMain", (String) s.global.get("installPath"));
		this.atocoframe=atocoframe;
		initialize();
		this.setPreferredSize( new Dimension( 400, 500 ) );
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		jLabel6 = new JLabel();
		jLabel6.setBounds(new Rectangle(515, 60, 70, 16));
		jLabel6.setText((String) labels.get("jLabel6"));
		jLabel6.setFont(new java.awt.Font("Arial", Font.BOLD, 10));
		jLabel6.setForeground(c);
		jLabel5 = new JLabel();
		jLabel5.setBounds(new Rectangle(216, 329, 161, 29));
		jLabel5.setText((String) labels.get("jLabel5"));
		jLabel5.setFont(new java.awt.Font("Comic Sans MS", Font.BOLD, 14));
		jLabel5.setForeground(c);
		jLabel5.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				atocoframe.contentPane(new DataIntegrityList(atocoframe));
			}
		});
		jLabel4 = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/filelist.gif"));
		jLabel4.setBounds(new Rectangle(74, 264, 136, 163));
		jLabel4.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				atocoframe.contentPane(new DataIntegrityList(atocoframe));
			}
		});
		jLabel3 = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/questionmark.jpg"));
		jLabel3.setBounds(new Rectangle(38, 330, 26, 24));
		jLabel3.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				jScrollPane.setVisible(true);
				jLabel5.setVisible(true);
				jTextArea.setText((String) labels.get("list"));
			}
		});
		jLabel2 = new JLabel();
		jLabel2.setBounds(new Rectangle(208, 139, 151, 27));
		jLabel2.setText((String) labels.get("jLabel2"));
		jLabel2.setForeground(c);
		jLabel2.setFont(new java.awt.Font("Comic Sans MS", Font.BOLD, 14));
		jLabel2.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				atocoframe.contentPane(new DataIntegrityCreateFile(atocoframe));
			}
		});
		jLabel1 = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/file2.gif"));
		jLabel1.setBounds(new Rectangle(74, 28, 129, 192));
		jLabel1.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				atocoframe.contentPane(new DataIntegrityCreateFile(atocoframe));
			}
		});
		jLabel = new JLabel(new ImageIcon((String) s.global.get("installPath") + File.separator + "images/en/questionmark.jpg"));
		jLabel.setBounds(new Rectangle(39, 141, 25, 25));
		jLabel.addMouseListener(new java.awt.event.MouseAdapter() {
			public void mouseClicked(java.awt.event.MouseEvent e) {
				jScrollPane.setVisible(true);
				jLabel5.setVisible(true);
				jTextArea.setText((String) labels.get("create"));
			}
		});
		this.setSize(741, 451);
		this.setLayout(null);
		this.add(jLabel, null);
		this.setBackground(Color.WHITE);
		this.add(jLabel1, null);
		this.add(jLabel2, null);
		this.add(jLabel3, null);
		this.add(jLabel4, null);
		this.add(jLabel5, null);
		this.add(getJScrollPane(), null);
		this.add(jLabel6, null);
	}

	/**
	 * This method initializes jScrollPane	
	 * 	
	 * @return javax.swing.JScrollPane	
	 */
	private JScrollPane getJScrollPane() {
		if (jScrollPane == null) {
			jScrollPane = new JScrollPane();
			jScrollPane.setBounds(new Rectangle(420, 80, 286, 302));
			jScrollPane.setViewportView(getJTextArea());
			jScrollPane.setBorder(empty);
		}
		return jScrollPane;
	}

	/**
	 * This method initializes jTextArea	
	 * 	
	 * @return javax.swing.JTextArea	
	 */
	private JTextArea getJTextArea() {
		if (jTextArea == null) {
			jTextArea = new JTextArea();
			jTextArea.setBackground(TAc);
			jTextArea.setLineWrap(true);
			jTextArea.setWrapStyleWord(true);
			jTextArea.setEditable(false);
		}
		return jTextArea;
	}

}  //  @jve:decl-index=0:visual-constraint="-233,18"